package com.skywork.dao;

import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Update;

import com.skywork.domain.AccessToken;
import com.skywork.domain.base.MyMapper;

@Mapper
public interface AccessTokenMapper extends MyMapper<AccessToken> {

	/**
	 * 將该渠道所有有效token置为无效
	 * @param channelId
	 */
	@Update("UPDATE cfg.access_token SET active_flag=0,modify_date = getDate()  WHERE active_flag=1 AND channel_id=#{channelId}")
	void updateInActiveByChannelId(@Param("channelId") long channelId);

}
